
<table width="100%">
<tr>
<td class="style3">
	<a href="frontpage.php">Home</a>>
<?php
  if ($_GET['logout']==1) {
    unset($_SESSION['valid_login']);
  }
  else {
?>
  <a href="show_depart.php">Departments</a>>
  <a href="show_staffroom.php?d_id=<?php 
                                     if (isset($_GET['d_id'])) {
                                       echo $_GET['d_id'];
                                     }
                                     else {
                                        $link = mysql_connect('', 'admin_xbq', 'nihao')
                                            or die('Could not connect: ' . mysql_error());
                                        //echo "Connected successfully\n";
                                        mysql_query('use test');
                                        $sql = 'select depart_ID from staffroom where staffroom.sr_ID='.$_GET['sr_id'];
                                        $result = mysql_query($sql) or die('Query faileda: ' . mysql_error());
                                        $line = mysql_fetch_array($result, MYSQL_ASSOC);
                                        mysql_close($link);
                                        echo $line['depart_ID'];
                                     }
                                   ?>">Staff room</a>
<?php
  }
?>
</td>
<td class="style3" align="right">
	<a href="<?echo $_SERVER['PHP_SELF'];?>?logout=1">Sign out</a>
</td>
</tr>
</table>
